//
//  UILabel+BySelectedStatus.m
//  ewelisten
//
//  Created by pro on 17/3/7.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "UILabel+BySelectedStatus.h"
static const void *BySelectedKey = &BySelectedKey;

@implementation UILabel (BySelectedStatus)

- (void)setSelected:(BOOL)selected {
    
    objc_setAssociatedObject(self, BySelectedKey, @(selected), OBJC_ASSOCIATION_ASSIGN);
    
    if (selected) {
//        self.userInteractionEnabled = NO;
        self.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
    } else {
//        self.userInteractionEnabled = YES;
        self.backgroundColor = BY_THEME_COLOR;
    }
}
- (BOOL)selected {
    
    return [objc_getAssociatedObject(self, BySelectedKey) boolValue];
}


@end
